//
//  DTUIPullToRefresh.m
//  PersonalManager
//
//  Created by user on 16/8/15.
//  Copyright © 2016年 Haiyun.Qian. All rights reserved.
//

#import "DTUIPullToRefresh.h"
#import "DTWebViewController.h"
@interface DTUIPullToRefresh()<UIGestureRecognizerDelegate>

@end

@implementation DTUIPullToRefresh

//启用下拉刷新
-(void)enable:(DTJavascriptCommand *)command {
    self.command  = command;
    self.commandVC = (DTWebViewController *)command.controller;
    [_commandVC.webView addGestureRecognizer:_commandVC.recognizer];
}

//收起下拉loading
-(void)stop:(DTJavascriptCommand *)command {
    // 刪除手势的方法
    if (_commandVC) {
        [_commandVC.webView removeGestureRecognizer:_commandVC.recognizer];
    }
    
}

//禁用下拉刷新
-(void)disable:(DTJavascriptCommand *)command {
    // 刪除手势的方法
    if (_commandVC) {
        [_commandVC.webView removeGestureRecognizer:_commandVC.recognizer];
    }
}



@end
